package com.asset.pojo;

import com.asset.config.BigDecimalSerializer;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 采购信息
 * @author 11725
 */
@Data
@Table(name = "tab_purchase")
public class Purchase {
    /** 采购单编号 */
    @Id
    @KeySql(useGeneratedKeys = true)
    @Column(name = "purchase_id")
    private Long id;

    /** 采购员编号 */
    private Long userId;

    /** 所属部门编号 */
    private Long depaId;

    /** 审批状态：0待审批/1已批准/2未批准 */
    @Column(name = "approval_state")
    private Integer status;

    /** 申请采购资金 */
    @JsonSerialize(using = BigDecimalSerializer.class)
    private BigDecimal applyFund;

    /** 批准采购资金 */
    @JsonSerialize(using = BigDecimalSerializer.class)
    private BigDecimal approvalFund;

    /** 采购提交时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date applyTime;

    /** 审批时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date approvalTime;
}
